<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page import="java.util.HashMap"%>
<%@ include file="/WEB-INF/views/tag.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>修改部门信息</title>
<LINK rel="stylesheet" type="text/css" href="${baseurl}js/easyui/styles/default.css">
<%@ include file="/WEB-INF/views/common_css.jsp"%>
<%@ include file="/WEB-INF/views/common_js.jsp"%>

<script type="text/javascript">
	
/* 表单异步提交 */
$(function(){
	 $("#submit").click(function(){
         $("#itemForm").ajaxSubmit({
       	 url: "${pageContext.request.contextPath }/department/save",
            dataType: "html",//返回数据类型
            //提交成功后回调函数
            success: function(returnedDate){
           	 
           	 if(returnedDate=="success"){
           		 $.messager.confirm('修改部门', '修改成功！是否关闭?', function(r){
        				if (r){
        					//关闭弹出修改框
        					parent.closemodalwindow();
        					//选中创建的列表框（并刷新）
        					parent.parent.$('#tabs').tabs('select','部门管理');
        					
        				}
        			});
           		
           	 }else{
           		 $.messager.alert('修改部门',returnedDate,'info');
           	 }
           	 
            }
        }); 
	 });
});
	 
</script>
</head>
<body>
	<form:form id="itemForm" method="POST" modelAttribute="department">
		<br/><br/>
		<table width="50%" border=1 align="center">
			<c:if test="${department.departmentId!=null }">
						<form:hidden path="departmentId"/>
						<form:hidden path="departmentCompanyId"/>
						<input type="hidden" name="_method" value="PUT">
			</c:if>
			<tr>
				<td align="right">部门名称:&nbsp;</td>
				<td>
						<form:input path="departmentName"/>
				</td>
				
			</tr>
		</table>
		<br/>
		<div align="center">
			<a href="#" class="easyui-linkbutton" data-options="iconCls:'icon-save'" id="submit">保存</a>
		</div>

	</form:form>
</body>

</html>